
const db = require('db');
const log = require('tools/log');
const { addLogging } = require('tools/sqlString');

module.exports = async ctx => {
    const { connection, run } = db.init();
    try {
        const body = ctx.request.body;
        const token = ctx.header.authorization;
        await addLogging(body, token, run)
        ctx.body = 'ok';
        ctx.status = 200;
    } catch (error) {
        ctx.status = 500;
        ctx.body = error;
        log('---------------------------------------------------');
        console.log(error);
    }
    connection.end();
}


/*
group:'/order/11'
type:'用户'
value:'12313'
*/